package org._649mset;

import edu.wpi.first.wpilibj.*;

public class Robot2011 extends SimpleRobot {

    Joystick myXbox;
    ArcadeDT myDT;

    public Robot2011() {
        myXbox = new Joystick(1);
        myDT = new ArcadeDT(new int[] {1,3,4,2});
        getWatchdog().setEnabled(true);
        getWatchdog().setExpiration(.5);
    }

    public void autonomous() {
        while(isAutonomous() && isEnabled()) {
            getWatchdog().feed();
        }
    }

    public void operatorControl() {
        while(isOperatorControl() && isEnabled()) {
            getWatchdog().feed();
            myDT.drive(fixInput(myXbox.getY()),fixInput(myXbox.getTwist()));
        }
    }

    public double fixInput(double input) {
        if(Math.abs(input) < 0.15) input = 0;
        return input;
    }
}

